#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

int main() {
    int n = 0;
    scanf("%d", &n);
    int count = 0;
    int j = 0;
    for (j = 1; j <= n; j++)
    {
        int i = 0;
        int sum = 0;
        for (i = 1; i < j; i++)
        {
            if (j % i == 0)
            {
                sum += i;
            }
        }
        if (sum == j)
        {
            count++;
        }
    }
    printf("%d\n", count);
    return 0;
}